package com.cade.agriculturemall.view.personalCenter.discount;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.cade.agriculturemall.base.BaseFragment;
import com.cade.agriculturemall.view.personalCenter.discount.myDiscountFragment.MyDiscountFragment;
import com.cade.agriculturemall.view.personalCenter.discount.storeDiscountFragment.StoreDiscountFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by hshunxin on 2018/2/24.
 */

public class DiscountPagerAdapter extends FragmentPagerAdapter {
    private List<BaseFragment> mFragments = new ArrayList<>();
    private String[] title = new String[]{"我的券", "领取券"};

    public DiscountPagerAdapter(FragmentManager fm) {
        super(fm);
        mFragments.add(new MyDiscountFragment());
        mFragments.add(new StoreDiscountFragment());

    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }

    @Override
    public int getCount() {
        return mFragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return title[position];
    }

}
